<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/pub/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>贝易后台管理--课程列表</title>
<link href="<%=request.getContextPath() %>/css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript">

    function addproject(){

        var url = "<c:url value="/clazz/clazzList?m=add"/>";
        location=url;
    }

function del(id){

    location='<c:url value="/clazz/clazzdel?m=del&id="/>'+id;

}
function search(){

	var industryId = $("#industryId").val();
	var url = "<c:url value="/clazz/clazz/clazz.do?m=list"/>";
	if(industryId!=""){
		url+="&industryId="+industryId;
	}

	location=url;
}


function changeselect(){
	var url='<c:url value="/clazz/clazzList?m=list"/>';

	if($("#industryId").val()!=""){
		url+='&industryId='+$("#industryId").val();
	}
	location=url;
}
</script>
</head>
<body>
<div class="content">
<jsp:include page="../pub/top.jsp"></jsp:include>
<!--头部结束-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="left" valign="top">
<jsp:include page="../pub/left_clazz.jsp"></jsp:include>
</td>
<td valign="top">
	<div id="c01">
	<dl>
	<dt style="padding-right:20px;">从业科目（行业）：
		<select id="industryId" name="industryId" style="width:100px;" onchange="changeselect()">
		<option value="0">全部</option>
		<c:forEach items="${industryList}" var="industry">
			<option value="${industry.name}" ${industry.name==param.industryId?'selected=selected':''}><c:out value="${industry.value}"/></option>
		</c:forEach>
		</select>

	</dt>
	<dt>关键字:<input type="text" class="qidian" id="key" name="key" value="${key}"/> </dt>
	<dd style="padding-right:30px;><input type="button" value="查询" class="chaxun" onclick="search()"/></dd>
        <dd ><input type="button" value="新增课程" class="chaxun" onclick="addproject()"/></dd>
	</dl>
	  <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#dae2e5">
	    <tr>
	      <td width="10%" height="30" bgcolor="#e5edfa" align="center">序号</td>
            <td width="5%" height="30" bgcolor="#e5edfa" align="center" style="color: #cc0000"> 课程ID</td>
	      <td width="15%" height="30" bgcolor="#e5edfa" align="center">名称</td>
          <td width="5%" height="30" bgcolor="#e5edfa" align="center">所属行业</td>
	      <td width="5%" height="30" bgcolor="#e5edfa" align="center">价格</td>
	      <td width="10%" height="30" bgcolor="#e5edfa" align="center">开放时间</td>
            <td width="20%" height="30" bgcolor="#e5edfa" align="center">图</td>
	      <td width="10%" height="30" bgcolor="#e5edfa" align="center">操作选项</td>
	    </tr>
		<c:choose>
		<c:when test="${not empty clazzList}">
		<c:forEach items="${clazzList}" var="clazz" varStatus="vs">
		<tr>
	      <td height="30" bgcolor="#FFFFFF" align="center">
	        <input type="checkbox" name="clazzId" value="${clazz.id}"/> 
	        <c:out value="${vs.index+1}"/></td>
            <td height="30" bgcolor="#FFFFFF" align="center" style="color: #cc0000"><c:out value="${clazz.id}"/></td>
	      <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;"><a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a></td>
	      <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${clazz.industry}"/></td>
	      <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${clazz.price}"/></td>
          <td height="30" bgcolor="#FFFFFF" align="center"><c:out value="${clazz.openTime}"/></td>
          <td height="30" bgcolor="#FFFFFF" align="center"> <a href="<c:out value="${clazz.img}"/>" > <c:out value="${clazz.img}"/></a></td>
	      <td  height="30" bgcolor="#FFFFFF" align="center">
	      	<%--<a href="<c:url value="/admin/clazzedit?m=edit&id=${clazz.id}"/>">修改</a>--%>
	      	<a href="javascript:del(${clazz.id})">删除</a>
	      </td>
	    </tr>				
	    </c:forEach>
		</c:when>
		<c:otherwise>
		<tr>
			<td colspan="6" height="30" bgcolor="#ffffff" align="center">暂无数据</td>
		</tr>	
		</c:otherwise>
		</c:choose>
	  </table>
	  <%--<p><input type="checkbox" onclick="selectAll(this)"/> 全选 --%>
	  <%--<input type="button" value="删除" class="shanchu" onclick="del(0)"/></p>--%>
	  <%--<jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>--%>
	</div>
	<br />
	<br />
</td>
</tr>
</table>
<jsp:include page="../pub/foot.jsp"></jsp:include>
</div>
</body>
</html>
